package com.xlh.enums.courseTest;

import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

/**
 * @author zhr 2019/3/2
 */
@Getter
@AllArgsConstructor
public enum PracticeSaveEnum {
    SAVE(1, "保存随堂练习答题情况"),
    SUBMIT(2, "提交答题卡");

    private static Logger logger = LoggerFactory.getLogger(PracticeSaveEnum.class);

    private final Integer type;
    private final String message;

    private static Map<Integer,PracticeSaveEnum> typeLookup = Maps.newHashMap();

    static {
        for (PracticeSaveEnum typeEnum: PracticeSaveEnum.values()){
            typeLookup.put(typeEnum.getType(), typeEnum);
        }
    }

    public static PracticeSaveEnum forType(Integer type) {
        return typeLookup.get(type);
    }

}
